<?php
/**
 * 招聘频道页，已做缓存处理
 * 如需改变仅调整这里即可
 */
useCahe();
include_once("$config[webroot]/module/job/includes/plugin_hr_class.php");
$hr=new hr();
$flag=md5($dpid.$dcid.$config["temp"].$_COOKIE["langtw"]);
if(!$tpl->is_cached("job_index.htm",$flag))
{	
	include_once("module/job/lang/".$config['language']."/lang_hr_config.php");
	$tpl->assign("hrmoney",$hrmoney);
	$tpl->assign("job_type",$job_type);
	$tpl->assign("degree",$degree);
	//=============================行业类别列表
	$tpl->assign("cat",get_comcat());
	//==============================职业类别
	include_once("module/job/lang/".$config['language']."/lang_hr_config.php");
	$sql="select id,catname from ".HRCAT." order by posid";
    $db->query($sql);
    $hrcat=$db->getRows();
	$tpl->assign("hrcat",$hrcat);
	$tpl->assign("hrdropdate",$hrdropdate);
	
	$tsql=NULL;
	if(!empty($dpid))
		$tsql=" and b.province='$dpid' ";
	if(!empty($dcid))
		$tsql=" and b.city='$dcid' ";
		
	//===============================最新招聘公司		
	$sql="select a.*,b.company from ".ZP." a ,".USER." b where a.userid=b.userid $tsql order by uptime desc limit 0,8";
	$db->query($sql);
	$hrlist=$db->getRows();
	$tpl->assign("hrlist",$hrlist);
	
	//===============================企业招聘
	$sql="select a.*,b.company,province,city from ".ZP." a ,".USER." b where a.userid=b.userid $tsql limit 0,8";
	$db->query($sql);
	$hrlisttj=$db->getRows();

	$tpl->assign("rechrlist",$hrlisttj);
	
	//===============================人才简历
	$sql="select * from ".RESUME." a  left join ".HRCAT." c on a.catid=c.id,".ALLUSER." b  where a.userid=b.userid $tsql limit 0,8";

	$db->query($sql);
	$re=$db->getRows();

	$tpl->assign("resume",$re);
}
////==201208015 小郑===
//==获取本周热点数据Start====        
        $wtime=strtotime(date('Y-m-d', time()-86400*date('w')));//获取本周第一天的时间，这里以星期天为每周的第一天。
        $sql="select nid,title from ".NEWSD." where classid!=160 and uptime>$wtime order by onclick desc limit 9";
        $db->query($sql);
        $weektop=$db->getRows();
        

$tpl->assign("weektop",$weektop);
$tpl->assign("province",get_province());
$tpl->assign("hrcat",$hr->hrcat());
$tpl->assign("current","job");
include_once("footer.php");
$out=tplfetch("job_index.htm",$flag);
?>